Skip to content

fix(context): resolve amd-smi path in get_gpu_renderD_nodes (ROCM-27727)#156

Merged
coketaste merged 1 commit into
developfrom
coketaste/rocm-27727
Jul 15, 2026
Merged

fix(context): resolve amd-smi path in get_gpu_renderD_nodes (ROCM-27727)#156
coketaste merged 1 commit into
developfrom
coketaste/rocm-27727

Conversation

@coketaste

Copy link
Copy Markdown
Collaborator

Summary

  • get_gpu_renderD_nodes() invoked amd-smi as a bare command, relying on it being on PATH. On hosts where /opt/rocm*/bin is not on PATH (e.g. CentOS 9 / MI350 CI runners), the subprocess failed with exit code 127 ("command not found"), causing GPU detection—and the run phase—to abort.
  • Every other amd-smi/rocminfo call site in context.py already resolves the binary via self._rocm_path (e.g. vendor detection at line ~421, rocminfo at line ~552). This fix brings the modern amd-smi list -e --json call in line with that pattern by resolving os.path.join(self._rocm_path, "bin", "amd-smi") before invoking it.
  • Fixes phantom_disagg_llama70b_mi350 and phantom_disagg_proxy_moe_mi350 failing with:

amd-smi was invoked as a bare command, relying on PATH, while every
other call site in this file resolves it via self._rocm_path. On
hosts where /opt/rocm*/bin is not on PATH, this caused GPU detection
to fail with exit code 127 (ROCM-27727).

Co-authored-by: Cursor <cursoragent@cursor.com>
@coketaste coketaste self-assigned this Jul 14, 2026
Copilot AI review requested due to automatic review settings July 14, 2026 20:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes AMD GPU render node detection on hosts where ROCm binaries are not on PATH by invoking amd-smi via the resolved ROCm installation root (self._rocm_path), aligning get_gpu_renderD_nodes() with other ROCm tool call sites in context.py.

Changes:

  • Resolve amd-smi to ${ROCM_PATH}/bin/amd-smi before calling amd-smi list -e --json.
  • Keep the existing stderr-handling fallback behavior while avoiding reliance on PATH.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/madengine/core/context.py
@coketaste
coketaste merged commit 6ca1dd7 into develop Jul 15, 2026
1 check passed
coketaste added a commit that referenced this pull request Jul 16, 2026
Summarizes the develop-vs-main delta: amd-smi path resolution fix,
unscoped tag matching for dir-prefixed model names, and corrected
directory-scoped tag examples in the docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants